Socket
Socket
Sign inDemoInstall

@voiceflow/verror

Package Overview
Dependencies
Maintainers
27
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@voiceflow/verror

xtrct.io error class


Version published
Maintainers
27
Created
Source

circle ci Coverage Quality Gate Status

verror

Voiceflow error class

Install

npm i -S @voiceflow/verror

Use

const VError = require('@voiceflow/verror');

// Throws error which inheirits from Error and has a default http code of 500 INTERNAL_SERVER_ERROR
const throws = () => { throw new VError('boom'); };

// Throw with a different http code
// VError.HTTP_STATUS is just the 'http-status' package
const throwsWithHttpError = () => { throw new VError('boom', VError.HTTP_STATUS.BAD_REQUEST); };

// Throw with special data
const throwsWithData = () => { throw new VError('boom', undefined, {foo: 'bar'}); };

verror

Kind: global class

new verror(message, [code], [data])

ParamTypeDefaultDescription
messagestringerror message
[code]number500http error code
[data]anyany extra data to attach to the error

Keywords

FAQs

Package last updated on 19 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc